package com.zhl.api_object7;
//默认继承Object类
public class Student {
    private String name;
    private double score;

    public Student() {}

    @Override
    public String toString() {
        return "student"+"{" +
                "name='" + name + '\'' +
                ", score=" + score +
                '}';
    }

    @Override
    public boolean equals(Object obj) {
        if(this == obj) return true;
        if(obj == null || getClass()!= obj.getClass()) return false;
        Student student = (Student) obj;
        return Double.compare(student.score, score) == 0 &&
                name.equals(student.name);
    }

    public Student(double score, String name) {
        this.score = score;
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }
}
